"""tracer URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include
from web.views import dashboard
from web.views import wiki 
from web.views import account, project, manage, files, setting, issues,statistics,payment
# web
urlpatterns = [
    # path('admin/', admin.site.urls),

    # project index/display
    path('project_show/',project.show, name='show'),
    path('project/list/',project.project_list, name='project_list'),
    path('project_star/<str:project_type><str:project_id>',project.project_star, name='project_star'),
    path('project_unstar/<str:project_type><str:project_id>',project.project_unstar, name='project_unstar'),
    path('payment/<int:policy_id>/',payment.policy_payment, name='policy_payment'),
    path('pay/',payment.pay, name='pay'),
    path('pay/notify/',payment.pay_notify, name='pay_notify'),
    path('pay/success/',payment.pay_success, name='pay_success'),
    path('pay/cart/',payment.pay_cart, name='pay_cart'),
    path('pay/cart/order/delete/',payment.pay_order_delete, name='pay_order_delete'),


    # project management
    # path('manage/<int:project_id>/dashboard/',dashboard.dashboard, name='dashboard'),
    path('manage/<int:project_id>/',include([
        path('dashboard/',dashboard.dashboard,name='dashboard'),
        path('dashboard/issue/chart',dashboard.issue_chart,name='issue_chart'),
        
        path('statistics/',statistics.statistics,name='statistics'),
        path('statistics/priority/chart',statistics.priority_chart,name='priority_chart'),
        path('statistics/projectuser/chart',statistics.statistics_projectuser,name='statistics_projectuser'),
        
        
        path('files/',files.files,name='files'),
        path('files/delete/',files.files_delete,name='files_delete'),
        path('files/upload/',files.files_upload,name='files_upload'),
        path('cos/credential/',files.cos_credential,name='cos_credential'),
        path('files/sizeauth/',files.files_size_auth,name='files_sizeauth'),
        path('files/download/',files.file_download,name='file_download'),
        
        path('wiki/',wiki.wiki,name='wiki'),
        path('wiki/add/',wiki.wiki_add,name='wiki_add'),
        path('wiki/<int:wiki_id>/edit/',wiki.wiki_edit,name='wiki_edit'),
        path('wiki/<int:wiki_id>/delete/',wiki.wiki_delete,name='wiki_delete'),
        path('wiki/catalog/',wiki.wiki_catalog,name='wiki_catalog'),
        path('wiki/upload/',wiki.wiki_upload,name='wiki_upload'),

        path('settings/',setting.setting ,name='setting'),
        path('settings/delete/',setting.setting_delete ,name='setting_delete'),
        
        path('issues/',issues.issues,name='issues'),
        path('issues/details/<int:issue_id>/',issues.issue_detail,name='issue_detail'),
        path('issues/record/<int:issue_id>/',issues.issues_record,name='issues_record'),
        path('issues/change/<int:issue_id>/',issues.issue_change,name='issue_change'),
        path('issues/invite/',issues.invite_url,name='invite_url'),
        ])),

    # login/register/logout
    path('register/', account.register,name='register'),
    path('send/sms/', account.send_sms,name='send_sms'),
    path('image/code/', account.image_code,name='image_code'),
    path('index/', account.index,name='index'),
    path('index_login/', account.index_login,name='index_login'),
    path('login/', account.login,name='login'),
    path('login/sms/', account.login_sms,name='login_sms'),
    path('logout/', account.logout,name='logout'),
    path('price/', payment.price_show,name='price_show'),
    # path('submit_code/', views.submit_code),

    path('invite/<str:code>/',issues.invite_join,name='invite_join'),
    # path('index/', views.index),
    # path('login/', views.login),
]
